var keystone = require('keystone');
var async = require('async');
var _ = require('lodash');
var waterfall = require('async/waterfall');
var each = require('async/each');
var eachOf = require('async/eachOf');
var eachSeries = require('async/eachSeries');
var request = require('request');
var Promise = require("bluebird");
var ObjectId = require('mongoose').Types.ObjectId;

exports = module.exports = function (req, res) {

    const locals = res.locals;
    locals.data = {};

    if (req.path === '/app_info/is_published') {
        const { version } = req.query;
        keystone.list('AppInfo').model
        .findOne({ version })
        .exec((err, app_info) => {
          if (err) {
            return res.json({});
          }
          if(!app_info) {
            return res.json({});         
          } else {
            return res.json(app_info); 
          }
        });
    }
    else {
        return res.json({}); 
    }


}


